import static org.junit.Assert.*;
import org.junit.After;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;


public class LiczbaTest1 {
	Liczba l = null;
	
	@Ignore
	public void Test(){
		l = new Liczba();
	}
	
	@Before
	public void setUp() throws Exception {
		l = new Liczba();
	}

	@After
	public void tearDown() throws Exception {
		l = null;
	}

	@Test
	public final void testSetValue() {
		assertNotNull(l);
	}
	
	@Test(timeout = 1000)
	public final void testConvertTo() {
		for(int j = 2 ; j<16 ; j++){
			for(int i = 0 ; i < 1000; i++){
				try{
					l.setValue(i);
					String result = l.convertTo(j);
					assertNotNull(l);
					assertTrue("Wrong result" , result.equals(Integer.toString(i, j)));
					assertEquals("Wrong result" , result , Integer.toString(i,j));
					assertNotSame("Wrong result" , result.equals(Integer.toString(i,j)) == true);
					if(l == null)
						fail("Wrong result");
				}catch(LiczbaExcept e){
					System.out.println(e.getMessage());
				}
			}
		}
	}

}
